Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

feature/node/src/commonMain/kotlin/org/meshtastic/feature/node/metrics/ChartStyling.kt 492afbde5c98f3efdcd367ab2f13ef3665fe7388 (492afbde) Text, 13.78 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.node.metrics

Tff7b72import T7ee787androidx.compose.foundation.shape.CircleShape
Tff7b72import T7ee787androidx.compose.material3.MaterialTheme
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.remember
Tff7b72import T7ee787androidx.compose.ui.graphics.Brush
Tff7b72import T7ee787androidx.compose.ui.graphics.Color
Tff7b72import T7ee787androidx.compose.ui.text.SpanStyle
Tff7b72import T7ee787androidx.compose.ui.text.TextStyle
Tff7b72import T7ee787androidx.compose.ui.text.buildAnnotatedString
Tff7b72import T7ee787androidx.compose.ui.text.font.FontWeight
Tff7b72import T7ee787androidx.compose.ui.text.withStyle
Tff7b72import T7ee787androidx.compose.ui.unit.dp
Tff7b72import T7ee787androidx.compose.ui.unit.sp
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.cartesian.axis.Axis
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.cartesian.data.CartesianLayerRangeProvider
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.cartesian.decoration.Decoration
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.cartesian.decoration.HorizontalLine
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.cartesian.layer.LineCartesianLayer
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.cartesian.layer.rememberLine
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.cartesian.layer.rememberLineCartesianLayer
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.cartesian.marker.CartesianMarker
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.cartesian.marker.DefaultCartesianMarker
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.cartesian.marker.LineCartesianLayerMarkerTarget
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.cartesian.marker.rememberDefaultCartesianMarker
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.common.Fill
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.common.Insets
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.common.MarkerCornerBasedShape
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.common.Position
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.common.component.ShapeComponent
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.common.component.TextComponent
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.common.component.rememberLineComponent
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.common.component.rememberShapeComponent
Tff7b72import T7ee787com.patrykandpatrick.vico.compose.common.component.rememberTextComponent

T8b949e/**
* Utility object for chart styling and component creation. Provides reusable styled lines, points, and axes for Vico
* charts.
*
* **Design principles** (per [design#53](https://github.com/meshtastic/design/issues/53)):
* - Default to thin lines **without** point markers to avoid clutter on dense timeseries.
* - Show a single dot only at the marker/cursor position (handled by [rememberMarker]).
* - Use `Interpolator.cubic()` for smooth monotone curves that won't overshoot between sparse points.
* - Reserve bold lines for the single most-important series; use subtle/gradient fills for secondary data.
*/
Tf0883e@SuppressTb4b4b4(Ta5d6ff"Ta5d6ffTooManyFunctionsTa5d6ff"Tb4b4b4)
Tff7b72object T56d364ChartStyling Tb4b4b4{
T8b949e// Line stroke widths
Tff7b72const Tff7b72val Te6edf3THIN_LINE_WIDTH_DP Tff7b72= T79c0ff1.5f
Tff7b72const Tff7b72val Te6edf3MEDIUM_LINE_WIDTH_DP Tff7b72= T79c0ff2f
Tff7b72const Tff7b72val Te6edf3THICK_LINE_WIDTH_DP Tff7b72= T79c0ff2.5f

T8b949e/**
* Creates a clean timeseries line — thin, smooth, with **no** point markers. This is the default style recommended
* by Oscar's UX guidance: "thin lines, and maybe a dot where the cursor is."
*
* @param lineColor The color of the line
* @param lineWidth Width of the line in dp
* @param interpolator The line interpolation strategy. Defaults to monotone
* [cubic][LineCartesianLayer.Interpolator.cubic] which won't overshoot between sparse data points (unlike
* catmull-rom). Use [Sharp][LineCartesianLayer.Interpolator.Sharp] for discrete/integer metrics like hop counts.
* @return Configured [LineCartesianLayer.Line]
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffcreateStyledLineTb4b4b4(
Te6edf3lineColorTb4b4b4: Te6edf3ColorTb4b4b4,
Te6edf3lineWidthTb4b4b4: Tffa657Float Tff7b72= Te6edf3MEDIUM_LINE_WIDTH_DPTb4b4b4,
Te6edf3interpolatorTb4b4b4: Te6edf3LineCartesianLayerTb4b4b4.Te6edf3Interpolator Tff7b72= Te6edf3LineCartesianLayerTb4b4b4.Te6edf3InterpolatorTb4b4b4.Te6edf3cubicTb4b4b4(Tb4b4b4)Tb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3LineCartesianLayerTb4b4b4.Te6edf3Line Tff7b72= Te6edf3LineCartesianLayerTb4b4b4.Te6edf3rememberLineTb4b4b4(
Te6edf3fill Tff7b72= Te6edf3LineCartesianLayerTb4b4b4.Te6edf3LineFillTb4b4b4.Te6edf3singleTb4b4b4(Te6edf3FillTb4b4b4(Te6edf3lineColorTb4b4b4)Tb4b4b4)Tb4b4b4,
Te6edf3stroke Tff7b72= Te6edf3LineCartesianLayerTb4b4b4.Te6edf3LineStrokeTb4b4b4.Te6edf3ContinuousTb4b4b4(Te6edf3lineWidthTb4b4b4.Te6edf3dpTb4b4b4)Tb4b4b4,
Te6edf3interpolator Tff7b72= Te6edf3interpolatorTb4b4b4,
Tb4b4b4)

T8b949e/**
* Creates a line with a gradient area fill effect. Ideal for emphasising a single series or showing magnitude. The
* gradient goes from the line color at ~30% opacity to near-transparent.
*
* @param lineColor The primary color of the line
* @param lineWidth Width of the line in dp
* @return Configured [LineCartesianLayer.Line]
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffcreateGradientLineTb4b4b4(
Te6edf3lineColorTb4b4b4: Te6edf3ColorTb4b4b4,
Te6edf3lineWidthTb4b4b4: Tffa657Float Tff7b72= Te6edf3MEDIUM_LINE_WIDTH_DPTb4b4b4,
Te6edf3interpolatorTb4b4b4: Te6edf3LineCartesianLayerTb4b4b4.Te6edf3Interpolator Tff7b72= Te6edf3LineCartesianLayerTb4b4b4.Te6edf3InterpolatorTb4b4b4.Te6edf3cubicTb4b4b4(Tb4b4b4)Tb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3LineCartesianLayerTb4b4b4.Te6edf3Line Tb4b4b4{
Tff7b72val Te6edf3gradientBrush Tff7b72=
Te6edf3BrushTb4b4b4.Te6edf3verticalGradientTb4b4b4(Te6edf3colors Tff7b72= Te6edf3listOfTb4b4b4(Te6edf3lineColorTb4b4b4.Te6edf3copyTb4b4b4(Te6edf3alpha Tff7b72= T79c0ff0.3fTb4b4b4)Tb4b4b4, Te6edf3lineColorTb4b4b4.Te6edf3copyTb4b4b4(Te6edf3alpha Tff7b72= T79c0ff0.05fTb4b4b4)Tb4b4b4)Tb4b4b4)
Tff7b72return Te6edf3LineCartesianLayerTb4b4b4.Te6edf3rememberLineTb4b4b4(
Te6edf3fill Tff7b72= Te6edf3LineCartesianLayerTb4b4b4.Te6edf3LineFillTb4b4b4.Te6edf3singleTb4b4b4(Te6edf3FillTb4b4b4(Te6edf3lineColorTb4b4b4)Tb4b4b4)Tb4b4b4,
Te6edf3areaFill Tff7b72= Te6edf3LineCartesianLayerTb4b4b4.Te6edf3AreaFillTb4b4b4.Te6edf3singleTb4b4b4(Te6edf3FillTb4b4b4(Te6edf3gradientBrushTb4b4b4)Tb4b4b4)Tb4b4b4,
Te6edf3stroke Tff7b72= Te6edf3LineCartesianLayerTb4b4b4.Te6edf3LineStrokeTb4b4b4.Te6edf3ContinuousTb4b4b4(Te6edf3lineWidthTb4b4b4.Te6edf3dpTb4b4b4)Tb4b4b4,
Te6edf3interpolator Tff7b72= Te6edf3interpolatorTb4b4b4,
Tb4b4b4)
Tb4b4b4}

T8b949e/**
* Creates a bold line suitable for highlighting the primary metric in a multi-series chart.
*
* @param lineColor The color of the line
* @return Configured [LineCartesianLayer.Line]
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffcreateBoldLineTb4b4b4(
Te6edf3lineColorTb4b4b4: Te6edf3ColorTb4b4b4,
Te6edf3interpolatorTb4b4b4: Te6edf3LineCartesianLayerTb4b4b4.Te6edf3Interpolator Tff7b72= Te6edf3LineCartesianLayerTb4b4b4.Te6edf3InterpolatorTb4b4b4.Te6edf3cubicTb4b4b4(Tb4b4b4)Tb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3LineCartesianLayerTb4b4b4.Te6edf3Line Tff7b72=
Te6edf3createStyledLineTb4b4b4(Te6edf3lineColor Tff7b72= Te6edf3lineColorTb4b4b4, Te6edf3lineWidth Tff7b72= Te6edf3THICK_LINE_WIDTH_DPTb4b4b4, Te6edf3interpolator Tff7b72= Te6edf3interpolatorTb4b4b4)

T8b949e/**
* Creates a subtle line suitable for secondary metrics that should not dominate the chart.
*
* @param lineColor The color of the line
* @return Configured [LineCartesianLayer.Line]
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffcreateSubtleLineTb4b4b4(Te6edf3lineColorTb4b4b4: Te6edf3ColorTb4b4b4)Tb4b4b4: Te6edf3LineCartesianLayerTb4b4b4.Te6edf3Line Tff7b72=
Te6edf3createStyledLineTb4b4b4(Te6edf3lineColor Tff7b72= Te6edf3lineColorTb4b4b4, Te6edf3lineWidth Tff7b72= Te6edf3THIN_LINE_WIDTH_DPTb4b4b4)

T8b949e/**
* Creates a dashed secondary line. Useful for distinguishing two metrics that share the same axis without relying
* on colour alone.
*
* @param lineColor The color of the dashed line
* @return Configured [LineCartesianLayer.Line]
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffcreateDashedLineTb4b4b4(
Te6edf3lineColorTb4b4b4: Te6edf3ColorTb4b4b4,
Te6edf3interpolatorTb4b4b4: Te6edf3LineCartesianLayerTb4b4b4.Te6edf3Interpolator Tff7b72= Te6edf3LineCartesianLayerTb4b4b4.Te6edf3InterpolatorTb4b4b4.Te6edf3cubicTb4b4b4(Tb4b4b4)Tb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3LineCartesianLayerTb4b4b4.Te6edf3Line Tff7b72= Te6edf3LineCartesianLayerTb4b4b4.Te6edf3rememberLineTb4b4b4(
Te6edf3fill Tff7b72= Te6edf3LineCartesianLayerTb4b4b4.Te6edf3LineFillTb4b4b4.Te6edf3singleTb4b4b4(Te6edf3FillTb4b4b4(Te6edf3lineColorTb4b4b4)Tb4b4b4)Tb4b4b4,
Te6edf3stroke Tff7b72=
Te6edf3LineCartesianLayerTb4b4b4.Te6edf3LineStrokeTb4b4b4.Te6edf3DashedTb4b4b4(
Te6edf3thickness Tff7b72= Te6edf3THIN_LINE_WIDTH_DPTb4b4b4.Te6edf3dpTb4b4b4,
Te6edf3dashLength Tff7b72= T79c0ff6.Te6edf3dpTb4b4b4,
Te6edf3gapLength Tff7b72= T79c0ff3.Te6edf3dpTb4b4b4,
Tb4b4b4)Tb4b4b4,
Te6edf3interpolator Tff7b72= Te6edf3interpolatorTb4b4b4,
Tb4b4b4)

T8b949e/**
* Gets Material 3 theme-aware colors with opacity. Useful for creating color variants while respecting the current
* theme.
*
* @param baseColor The base color
* @param alpha The alpha/opacity value (0f-1f)
* @return Color with adjusted alpha
*/
Tff7b72fun Td2a8ffcreateThemedColorTb4b4b4(Te6edf3baseColorTb4b4b4: Te6edf3ColorTb4b4b4, Te6edf3alphaTb4b4b4: Tffa657Float Tff7b72= T79c0ff1fTb4b4b4)Tb4b4b4: Te6edf3Color Tff7b72= Te6edf3baseColorTb4b4b4.Te6edf3copyTb4b4b4(Te6edf3alpha Tff7b72= Te6edf3alphaTb4b4b4)

T8b949e/**
* Creates a [HorizontalLine] decoration for a reference threshold (e.g. battery low, pressure normal).
*
* @param y The y-value to draw the line at
* @param color The color of the threshold line
* @param label Optional label text for the line
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffrememberThresholdLineTb4b4b4(Te6edf3yTb4b4b4: Tffa657DoubleTb4b4b4, Te6edf3colorTb4b4b4: Te6edf3ColorTb4b4b4, Te6edf3labelTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4)Tb4b4b4: Te6edf3Decoration Tb4b4b4{
Tff7b72val Te6edf3line Tff7b72= Te6edf3rememberLineComponentTb4b4b4(Te6edf3fill Tff7b72= Te6edf3FillTb4b4b4(Te6edf3colorTb4b4b4.Te6edf3copyTb4b4b4(Te6edf3alpha Tff7b72= T79c0ff0.4fTb4b4b4)Tb4b4b4)Tb4b4b4, Te6edf3thickness Tff7b72= T79c0ff1.Te6edf3dpTb4b4b4)
Tff7b72val Te6edf3labelComponent Tff7b72=
Tff7b72if Tb4b4b4(Te6edf3label Tff7b72!Tff7b72= Tff7b72nullTb4b4b4) Tb4b4b4{
Te6edf3rememberTextComponentTb4b4b4(
Te6edf3style Tff7b72=
Te6edf3TextStyleTb4b4b4(Te6edf3color Tff7b72= Te6edf3colorTb4b4b4.Te6edf3copyTb4b4b4(Te6edf3alpha Tff7b72= T79c0ff0.7fTb4b4b4)Tb4b4b4, Te6edf3fontSize Tff7b72= T79c0ff9.Te6edf3spTb4b4b4, Te6edf3fontWeight Tff7b72= Te6edf3FontWeightTb4b4b4.Te6edf3MediumTb4b4b4)Tb4b4b4,
Te6edf3padding Tff7b72= Te6edf3InsetsTb4b4b4(Te6edf3horizontal Tff7b72= T79c0ff4.Te6edf3dpTb4b4b4, Te6edf3vertical Tff7b72= T79c0ff1.Te6edf3dpTb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4} Tff7b72else Tb4b4b4{
Tff7b72null
Tb4b4b4}
Tff7b72return Te6edf3rememberTb4b4b4(Te6edf3yTb4b4b4, Te6edf3colorTb4b4b4, Te6edf3labelTb4b4b4) Tb4b4b4{
Te6edf3HorizontalLineTb4b4b4(
Te6edf3y Tff7b72= Tb4b4b4{ Te6edf3y Tb4b4b4}Tb4b4b4,
Te6edf3line Tff7b72= Te6edf3lineTb4b4b4,
Te6edf3labelComponent Tff7b72= Te6edf3labelComponentTb4b4b4,
Te6edf3label Tff7b72= Tb4b4b4{ Te6edf3label Tff7b72?: Ta5d6ff"Ta5d6ff" Tb4b4b4}Tb4b4b4,
Te6edf3horizontalLabelPosition Tff7b72= Te6edf3PositionTb4b4b4.Te6edf3HorizontalTb4b4b4.Te6edf3EndTb4b4b4,
Te6edf3verticalLabelPosition Tff7b72= Te6edf3PositionTb4b4b4.Te6edf3VerticalTb4b4b4.Te6edf3TopTb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}

T8b949e/**
* Creates and remembers a default [CartesianMarker] styled for the Meshtastic theme.
*
* @param valueFormatter The formatter for the marker label content.
* @param showIndicator Whether to show the point indicator on the line/column.
* @return A configured [CartesianMarker]
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffrememberMarkerTb4b4b4(
Te6edf3valueFormatterTb4b4b4: Te6edf3DefaultCartesianMarkerTb4b4b4.Te6edf3ValueFormatter Tff7b72=
Te6edf3DefaultCartesianMarkerTb4b4b4.Te6edf3ValueFormatterTb4b4b4.Te6edf3defaultTb4b4b4(Te6edf3colorCode Tff7b72= Tff7b72trueTb4b4b4)Tb4b4b4,
Te6edf3showIndicatorTb4b4b4: Tffa657Boolean Tff7b72= Tff7b72trueTb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3CartesianMarker Tb4b4b4{
Tff7b72val Te6edf3labelBackground Tff7b72=
Te6edf3rememberShapeComponentTb4b4b4(
Te6edf3fill Tff7b72= Te6edf3FillTb4b4b4(Te6edf3MaterialThemeTb4b4b4.Te6edf3colorSchemeTb4b4b4.Te6edf3surfaceContainerHighTb4b4b4)Tb4b4b4,
Te6edf3shape Tff7b72= Te6edf3MarkerCornerBasedShapeTb4b4b4(Te6edf3MaterialThemeTb4b4b4.Te6edf3shapesTb4b4b4.Te6edf3extraSmallTb4b4b4)Tb4b4b4,
Te6edf3strokeFill Tff7b72= Te6edf3FillTb4b4b4(Te6edf3MaterialThemeTb4b4b4.Te6edf3colorSchemeTb4b4b4.Te6edf3outlineVariantTb4b4b4)Tb4b4b4,
Te6edf3strokeThickness Tff7b72= T79c0ff1.Te6edf3dpTb4b4b4,
Tb4b4b4)
Tff7b72val Te6edf3label Tff7b72=
Te6edf3rememberTextComponentTb4b4b4(
Te6edf3style Tff7b72=
Te6edf3TextStyleTb4b4b4(
Te6edf3color Tff7b72= Te6edf3MaterialThemeTb4b4b4.Te6edf3colorSchemeTb4b4b4.Te6edf3onSurfaceTb4b4b4,
Te6edf3fontWeight Tff7b72= Te6edf3FontWeightTb4b4b4.Te6edf3SemiBoldTb4b4b4,
Te6edf3fontSize Tff7b72= T79c0ff1T79c0ff2.Te6edf3spTb4b4b4,
Tb4b4b4)Tb4b4b4,
Te6edf3background Tff7b72= Te6edf3labelBackgroundTb4b4b4,
Te6edf3padding Tff7b72= Te6edf3InsetsTb4b4b4(Te6edf3horizontal Tff7b72= T79c0ff8.Te6edf3dpTb4b4b4, Te6edf3vertical Tff7b72= T79c0ff4.Te6edf3dpTb4b4b4)Tb4b4b4,
Te6edf3margins Tff7b72= Te6edf3InsetsTb4b4b4(Te6edf3bottom Tff7b72= T79c0ff4.Te6edf3dpTb4b4b4)Tb4b4b4,
Tb4b4b4)
Tff7b72val Te6edf3guideline Tff7b72=
Te6edf3rememberLineComponentTb4b4b4(
Te6edf3fill Tff7b72= Te6edf3FillTb4b4b4(Te6edf3MaterialThemeTb4b4b4.Te6edf3colorSchemeTb4b4b4.Te6edf3onSurfaceVariantTb4b4b4.Te6edf3copyTb4b4b4(Te6edf3alpha Tff7b72= T79c0ff0.2fTb4b4b4)Tb4b4b4)Tb4b4b4,
Te6edf3thickness Tff7b72= T79c0ff1.Te6edf3dpTb4b4b4,
Tb4b4b4)

Tff7b72val Te6edf3indicator Tff7b72=
Tff7b72if Tb4b4b4(Te6edf3showIndicatorTb4b4b4) Tb4b4b4{
T8b949e// Force alpha to 1f so the indicator is visible even for "invisible" lines
Tb4b4b4{ Te6edf3colorTb4b4b4: Te6edf3Color Tff7b72-Tff7b72> Te6edf3ShapeComponentTb4b4b4(Te6edf3fill Tff7b72= Te6edf3FillTb4b4b4(Te6edf3colorTb4b4b4.Te6edf3copyTb4b4b4(Te6edf3alpha Tff7b72= T79c0ff1fTb4b4b4)Tb4b4b4)Tb4b4b4, Te6edf3shape Tff7b72= Te6edf3CircleShapeTb4b4b4) Tb4b4b4}
Tb4b4b4} Tff7b72else Tb4b4b4{
Tff7b72null
Tb4b4b4}

Tff7b72return Te6edf3rememberDefaultCartesianMarkerTb4b4b4(
Te6edf3label Tff7b72= Te6edf3labelTb4b4b4,
Te6edf3valueFormatter Tff7b72= Te6edf3valueFormatterTb4b4b4,
Te6edf3guideline Tff7b72= Te6edf3guidelineTb4b4b4,
Te6edf3indicator Tff7b72= Te6edf3indicatorTb4b4b4,
Tb4b4b4)
Tb4b4b4}

T8b949e/**
* Creates a [DefaultCartesianMarker.ValueFormatter] that colors the text to match the series color.
*
* @param format A lambda that provides the string content for a given Y value and its series color.
*/
Tff7b72fun Td2a8ffcreateColoredMarkerValueFormatterTb4b4b4(
Te6edf3formatTb4b4b4: Tb4b4b4(Te6edf3valueTb4b4b4: Tffa657DoubleTb4b4b4, Te6edf3colorTb4b4b4: Te6edf3ColorTb4b4b4) Tff7b72-Tff7b72> Tffa657StringTb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3DefaultCartesianMarkerTb4b4b4.Te6edf3ValueFormatter Tff7b72= Te6edf3DefaultCartesianMarkerTb4b4b4.Te6edf3ValueFormatter Tb4b4b4{ Te6edf3_Tb4b4b4, Te6edf3targets Tff7b72-Tff7b72>
Te6edf3buildAnnotatedString Tb4b4b4{
Te6edf3targetsTb4b4b4.Te6edf3forEachIndexed Tb4b4b4{ Te6edf3indexTb4b4b4, Te6edf3target Tff7b72-Tff7b72>
Tff7b72if Tb4b4b4(Te6edf3index Tff7b72> T79c0ff0Tb4b4b4) Te6edf3appendTb4b4b4(Ta5d6ff"Ta5d6ff, Ta5d6ff"Tb4b4b4)
Tff7b72if Tb4b4b4(Te6edf3target Tff7b72is Te6edf3LineCartesianLayerMarkerTargetTb4b4b4) Tb4b4b4{
Te6edf3targetTb4b4b4.Te6edf3pointsTb4b4b4.Te6edf3forEachIndexed Tb4b4b4{ Te6edf3pointIndexTb4b4b4, Te6edf3point Tff7b72-Tff7b72>
Tff7b72if Tb4b4b4(Te6edf3pointIndex Tff7b72> T79c0ff0Tb4b4b4) Te6edf3appendTb4b4b4(Ta5d6ff"Ta5d6ff, Ta5d6ff"Tb4b4b4)
T8b949e// Pass the opaque color to the format lambda so callers can match without alpha gymnastics.
T8b949e// Apply 0.8 alpha only on the rendered text for readability.
Tff7b72val Te6edf3opaqueColor Tff7b72= Te6edf3pointTb4b4b4.Te6edf3colorTb4b4b4.Te6edf3copyTb4b4b4(Te6edf3alpha Tff7b72= T79c0ff1fTb4b4b4)
Tff7b72val Te6edf3text Tff7b72= Te6edf3formatTb4b4b4(Te6edf3pointTb4b4b4.Te6edf3entryTb4b4b4.Te6edf3yTb4b4b4, Te6edf3opaqueColorTb4b4b4)
Te6edf3withStyleTb4b4b4(Te6edf3SpanStyleTb4b4b4(Te6edf3color Tff7b72= Te6edf3opaqueColorTb4b4b4.Te6edf3copyTb4b4b4(Te6edf3alpha Tff7b72= Tb4b4b4.T79c0ff8fTb4b4b4)Tb4b4b4, Te6edf3fontWeight Tff7b72= Te6edf3FontWeightTb4b4b4.Te6edf3BoldTb4b4b4)Tb4b4b4) Tb4b4b4{
Te6edf3appendTb4b4b4(Te6edf3textTb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}

T8b949e/**
* Creates and remembers a [com.patrykandpatrick.vico.compose.common.component.TextComponent] styled for axis
* labels.
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffrememberAxisLabelTb4b4b4(Te6edf3colorTb4b4b4: Te6edf3Color Tff7b72= Te6edf3MaterialThemeTb4b4b4.Te6edf3colorSchemeTb4b4b4.Te6edf3onSurfaceVariantTb4b4b4)Tb4b4b4: Te6edf3TextComponent Tff7b72=
Te6edf3rememberTextComponentTb4b4b4(Te6edf3style Tff7b72= Te6edf3TextStyleTb4b4b4(Te6edf3color Tff7b72= Te6edf3colorTb4b4b4, Te6edf3fontSize Tff7b72= T79c0ff1T79c0ff0.Te6edf3spTb4b4b4, Te6edf3fontWeight Tff7b72= Te6edf3FontWeightTb4b4b4.Te6edf3MediumTb4b4b4)Tb4b4b4)
Tb4b4b4}

T8b949e/**
* Creates a [LineCartesianLayer] only when [hasData] is true, returning null otherwise.
*
* Extracts the repeated `if (data.isNotEmpty()) rememberLineCartesianLayer(...) else null` pattern used in every metric
* chart composable.
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffrememberConditionalLayerTb4b4b4(
Te6edf3hasDataTb4b4b4: Tffa657BooleanTb4b4b4,
Te6edf3lineProviderTb4b4b4: Te6edf3LineCartesianLayerTb4b4b4.Te6edf3LineProviderTb4b4b4,
Te6edf3verticalAxisPositionTb4b4b4: Te6edf3AxisTb4b4b4.Te6edf3PositionTb4b4b4.Te6edf3VerticalTb4b4b4,
Te6edf3rangeProviderTb4b4b4: Te6edf3CartesianLayerRangeProvider? Tff7b72= Tff7b72nullTb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3LineCartesianLayer? Tff7b72= Tff7b72if Tb4b4b4(Te6edf3hasDataTb4b4b4) Tb4b4b4{
Te6edf3rememberLineCartesianLayerTb4b4b4(
Te6edf3lineProvider Tff7b72= Te6edf3lineProviderTb4b4b4,
Te6edf3verticalAxisPosition Tff7b72= Te6edf3verticalAxisPositionTb4b4b4,
Te6edf3rangeProvider Tff7b72= Te6edf3rangeProvider Tff7b72?: Te6edf3CartesianLayerRangeProviderTb4b4b4.Te6edf3autoTb4b4b4(Tb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4} Tff7b72else Tb4b4b4{
Tff7b72null
Tb4b4b4}

Served by rngit 1.4.2 - Generated in 0.11s